package com.baidu.camera.adapter;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.ArrayList;

/**
 * Created by JGW-android on 2016/3/9.
 */
public class CameraItemAdapter extends BasicAdapter<String> {
    public CameraItemAdapter(final ArrayList<String> list, final Context context) {
        super(list, context, new BaseAdapterCallback() {
            @Override
            public View getView(int position, View convertView, ViewGroup parent, LayoutInflater inflater) {
                TextView tv;
                if (convertView == null) {
                    tv = new TextView(context);
                    tv.setGravity(Gravity.CENTER);
                } else {
                    tv = (TextView) convertView;
                }
                tv.setText(list.get(position));
                return tv;
            }
        });
    }
}
